//
//  GoodsTableViewCell.m
//  UGoods
//
//  Created by dllo on 16/1/16.
//  Copyright © 2016年 蓝鸥科技.李贺. All rights reserved.
//

#import "GoodsTableViewCell.h"
#import "FindModel.h"
#import <UIImageView+WebCache.h>
#import "ConstantsDefine.h"
@interface GoodsTableViewCell ()

@property (nonatomic, retain) UIImageView *coverImageView;

@end

@implementation GoodsTableViewCell

- (void)dealloc
{
    [_coverImageView release];
    [super dealloc];
}

- (instancetype)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier {
    self = [super initWithStyle:style reuseIdentifier:reuseIdentifier];
    if (self) {
        self.coverImageView = [[UIImageView alloc] init];
        [self.contentView addSubview:_coverImageView];
        [_coverImageView release];
    }
    return self;
}

- (void)layoutSubviews {
    [super layoutSubviews];
    self.coverImageView.frame = CGRectMake(0, 0, self.contentView.frame.size.width, self.contentView.frame.size.height - 10 * HEIGHT);
}

- (void)setModel:(FindModel *)model {
    if (_model != model) {
        [_model release];
        _model = [model retain];
    }
    
    [self.coverImageView sd_setImageWithURL:[NSURL URLWithString:model.cover] placeholderImage:[UIImage imageNamed:@"place"]];
   
    
}


/*
// Only override drawRect: if you perform custom drawing.
// An empty implementation adversely affects performance during animation.
- (void)drawRect:(CGRect)rect {
    // Drawing code
}
*/

@end
